<!--
 * @Description: 
 * @Autor: 商晓彬
 * @Date: 2021-06-23 12:09:31
 * @LastEditors: 商晓彬
 * @LastEditTime: 2022-01-06 14:20:00
-->
<div bsModal #createOrEditModal="bs-modal" (onShown)="onShown()" class="look modal fade" tabindex="-1" role="dialog"
    aria-labelledby="createOrEditModal" aria-hidden="true" [config]="{backdrop: 'static', keyboard: !saving}">
    <div style="width:1880px!important;margin: 1.75rem auto;">
        <div class="modal-content">
            <form *ngIf="active" #bopForm="ngForm" novalidate autocomplete="off">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span>{{title}}</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')"
                        [disabled]="saving">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="m-content">
                        <div class="row">
                            <div class="col-lg-4" style="height: 740px!important; overflow: auto;">
                                <span class="title">BOM1-3级别</span>
                                <div class="m-content">
                                    <div class="m-portlet m-portlet--mobile">
                                        <div class="m-portlet__body">
                                            <div class="row align-items-center">
                                                <div class="primeng-datatable-container">
                                                    <div class="col-md-12" style="
                                                                            float: left;
                                                                            height: 600px;
                                                       ">
                                                        <p-tree [value]="files2" selectionMode="single"
                                                            [(selection)]="selectedFiles"
                                                            (onNodeSelect)="nodeSelect($event)"
                                                            [style]="{ height: '90%' }" [loading]="loadingtree">
                                                            <ng-template let-node pTemplate="default">
                                                                <img class="imgcontent"
                                                                    src="../../../assets/common/images/三级图标.png"
                                                                    *ngIf="node.nodeLevel==8||node.nodeLevel==9"
                                                                    width="20" height="20" />
                                                                <img class="imgcontent"
                                                                    src="../../../assets/common/images/0.png"
                                                                    *ngIf="node.nodeLevel==undefind" width="20"
                                                                    height="20" />
                                                                <img class="imgcontent"
                                                                    src="../../../assets/common/images/1.png"
                                                                    *ngIf="node.nodeLevel==1" width="20" height="20" />
                                                                <img class="imgcontent"
                                                                    src="../../../assets/common/images/2.png"
                                                                    *ngIf="node.nodeLevel==2" width="20" height="20" />
                                                                <img class="imgcontent"
                                                                    src="../../../assets/common/images/3.png"
                                                                    *ngIf="node.nodeLevel==3" width="20" height="20" />
                                                                <img class="imgcontent"
                                                                    src="../../../assets/common/images/4.png"
                                                                    *ngIf="node.nodeLevel==4" width="20" height="20" />
                                                                <img class="imgcontent"
                                                                    src="../../../assets/common/images/5.png"
                                                                    *ngIf="node.nodeLevel==5" width="20" height="20" />
                                                                <span> {{node.materialName}} </span>
                                                            </ng-template>
                                                        </p-tree>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-8" style="height: 740px!important;overflow: auto;">
                                <div class="row align-items-center" style="margin-top: 25px;">
                                    <div class="primeng-datatable-container">
                                        <p-treeTable scrollHeight="600px" [lazy]="true" [value]="files1" [scrollable]="true"[loading]="loadingTable">
                                            <ng-template pTemplate="header">
                                                <tr>
                                                    <th style="width: 200px">Bom层级</th>
                                                    <th style="width: 150px">图号</th>
                                                    <th style="width: 150px">名称</th>
                                                    <th style="width: 150px">规格型号</th>
                                                    <th style="width: 150px">单位</th>
                                                    <th style="width: 150px">Bom用量</th>
                                                    <th style="width: 150px">年代号</th>
                                                    <th style="width: 150px">备注</th>
                                                    <th style="width: 150px">Bom版本</th>
                                                    <th style="width: 150px">属性</th>
                                                    <th style="width: 150px">类别</th>
                                                    <th style="width: 150px">细分类别</th>
                                                </tr>
                                            </ng-template>
                                            <ng-template pTemplate="body" let-rowNode let-rowData="rowData">
                                                <tr [ttRow]="rowNode"  *ngIf="rowData">
                                                    <td style="width: 200px">
                                                        <p-treeTableToggler [rowNode]="rowNode"></p-treeTableToggler>
                                                        {{rowData.levelNum}}
                                                    </td>
                                                    <td style="width: 150px">{{rowData.materialNo}}</td>
                                                    <td style="width: 150px">{{rowData.materialName}}</td>
                                                    <td style="width: 150px">{{rowData.model}}</td>
                                                    <td style="width: 150px">{{rowData.unitName}}</td>
                                                    <td style="width: 150px">
                                                        <span *ngIf="rowData.levelNum >= 4">{{rowData.unit1BomDosage}}</span>
                                                    </td>
                                                    <td style="width: 150px">
                                                        <span >{{rowData.yearsNo}}</span>
                                                    </td>
                                                    <td style="width: 150px">
                                                        <span *ngIf="rowData.levelNum >= 4">{{rowData.remark}}</span>
                                                    </td>
                                                    <td style="width: 150px">{{rowData.versionNo}}</td>
                                                    <td style="width: 150px">{{rowData.attribute}}</td>
                                                    <td style="width: 150px">{{rowData.materialTypeName}}</td>
                                                    <td style="width: 150px">{{rowData.materialSegmentationName}}</td>
                                                </tr>
                                            </ng-template>
                                        </p-treeTable>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
            </form>
        </div>
    </div>
</div>